<?php
namespace app\api\controller\v1;
use \think\Controller;
use think\Db;
class Base extends Controller{
	
	//得到用户标识
	public $user_info = [];
	//过滤限制权限
	public $filter = [
		'V1.User/open_sms',//获取验证码
		'V1.User/register',//注册
		'V1.User/login',//登陆
		'V1.User/upload_file',//上传图片
		'V1.User/forgot_password',//忘记密码
		
		'V1.Index/kindex',//上传图片
		'V1.Index/get_new_hangye',//上传图片
		'V1.Index/get_new_hangye_info',//上传图片
		'V1.Index/get_case_list',//上传图片
		'V1.Index/get_case_info',//上传图片
		
	]; 
	
	//初始化
	protected function initialize()
	{
		parent::initialize();
		$url = request()->controller() . '/' . request()->action();
		if(!in_array($url,$this->filter)){
			$user_id=input('user_id');
			$this->user_info=Db::name('user')->where('id',$user_id)->find();
		}
	}
	
}

